/**
 * 
 */
package com.googlecode.jasmincc.utils;

import java.io.*;
import static com.googlecode.ptrace.Ptrace.*;
import com.googlecode.jasmincc.framework.services.implementation.*;

/**
 * @author Sam
 *
 */
public class TestFileBuilder {
	public static void buildFiles(String src, String dist) throws Exception {
		MyFileNameFilter javaFileFilter = new MyFileNameFilter(".java");
		File dir = new File(src);
		ptrace(dir.isDirectory());
		File[] files = dir.listFiles(javaFileFilter);
		ptrace(files.length);
		for(File file : files) {
			String fileName = file.getName();
			int slash = fileName.lastIndexOf('/');
			int dot = fileName.lastIndexOf('.');
			String className = fileName.substring(slash + 1, dot);
			String testFileName = dist + "/" + className + "Test.test";
			ptrace(testFileName);
			File newFile = new File(testFileName);
			newFile.createNewFile();
		}
	}
	
	public static void main(String[] args) throws Exception {
		TestFileBuilder.buildFiles(args[0], args[1]);
	}
}

